import Service from '../utils/request'

interface IQueryNoteList {
    pageNo: number
    pageSize: number
}
interface ICreateNote {
    title: string
    content: string
    author: string
}
interface IUpdateNote {
    id: string
    title: string
    content: string
    author: string
}

// 获取笔记列表
export const getNoteList = (data: IQueryNoteList) => {
    return Service({
        url: '/api/note/getNoteList',
        method: 'post',
        data,
    })
}

// 获取笔记详情
export const getNoteDetails = (data: { id: string }) => {
    return Service({
        url: '/api/note/getNoteDetails',
        method: 'post',
        data,
    })
}

// 创建笔记
export const createNote = (data: ICreateNote) => {
    return Service({
        url: '/api/note/createNote',
        data,
        method: 'post',
    })
}

// 编辑笔记
export const updateNote = (data: IUpdateNote) => {
    return Service({
        url: '/api/note/updateNote',
        data,
        method: 'post',
    })
}

// 删除用户
export const deleteNote = (data: { id: string }) => {
    return Service({
        url: '/api/note/deleteNote',
        data,
        method: 'post',
    })
}
